/**gethodename sysconf*/
#include<stdio.h>
#include<stdlib.h>
#include<sys/utsname.h>
#include<sys/sysinfo.h>
#include<string.h>
#include<unistd.h>

int main()
{
	int ret;
	char hostname[20]={0};
	memset(hostname,0x0,sizeof(hostname));
	ret=gethostname(hostname,sizeof(hostname));
	if(-1==ret){
		perror("gethostname error");
		return 1;
	}
	puts(hostname);
	long child_max=sysconf(_SC_CHILD_MAX);
	printf("child_max:%ld\n",child_max);
	printf("clk_tck:%ld\n",sysconf(_SC_CLK_TCK));
	printf("pagesize:%ld\n",sysconf(_SC_PAGESIZE));
	return 0;
}
